package tech.aistar.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.mapper.MusiclinMapper;
import tech.aistar.pojo.SongList;
import tech.aistar.pojo.entity.Musiclin;

import java.util.List;

@Service
@Transactional
public class MusiclinServicelmpl implements MusiclinService{
    private SongListService songListService;
    private MusiclinMapper mapper;
    @Override
    public int insert(Musiclin musiclin,Integer id) {
        SongList songList =songListService.getBySongI(id);
        musiclin.setSongTitle(songList.getSongTitle());
        musiclin.setSingerName(songList.getSingerName());
        musiclin.setImgg(songList.getImgg());
        musiclin.setContent(songList.getContent());
        musiclin.setAudioSrc(songList.getAudioSrc());
        return mapper.insert(musiclin,id);
    }

    @Override
    public String sele(Integer id) {
        return null;
    }

    @Override
    public void dele() {

    }

    @Override
    public List<Musiclin> selectall() {

        return mapper.selectall();
    }
}
